<template>
  <div class="searchBox">
    <div class="search-header">
      <div class="header-input">
        <el-input placeholder="请输入搜索内容" v-model="searchText">
          <el-button slot="append" @click="queryData()">查 询</el-button>
        </el-input>
      </div>
      <public-header />
    </div>
    <div class="conentBox">
      <el-tabs v-model="activeName" @tab-click="handleClick" class="tabsBox">
        <el-tab-pane label="网页" name="first">
          <div class="relevant">为你找到相关约 100，000，000个</div>
          <relevant-pages />
        </el-tab-pane>

        <el-tab-pane label="视频" name="second">视频</el-tab-pane>
        <el-tab-pane label="图片" name="third">图片</el-tab-pane>
        <el-tab-pane label="网页" name="fourth">网页</el-tab-pane>
      </el-tabs>

      <div class="absolute-right">
        <el-tabs v-model="activeNameTwo">
          <el-tab-pane label="最新" name="first">
            <div class="tabRight">
              <div>
                <span class="right-color">01</span>最新股票涨跌最新股票涨跌...
              </div>
              <div>
                <span class="right-color">02</span>最新股票涨跌最新股票涨跌...
              </div>
              <div>
                <span class="right-color">03</span>最新股票涨跌最新股票涨跌...
              </div>
              <div>
                <span class="right-color">04</span>最新股票涨跌最新股票涨跌...
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="最热" name="second">视频</el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Home",
  data() {
    return {
      searchText: this.$route.query.text,
      activeName: "first",
      activeNameTwo: "first",
    };
  },
  components: {
    PublicHeader: () => import("../../components/PublicHeader"),
    RelevantPages: () => import("./components/RelevantPages"),
  },
  mounted() {
    console.log(this.$route.query.text);
  },
  methods: {
    queryData() {},
    handleClick() {},
  },
};
</script>
<style lang="less" scoped>
.searchBox {
  width: 70%;
  box-sizing: border-box;
  display: flex;
  flex-flow: column;

  .head-container {
    align-self: flex-end;
  }

  .search-header {
    position: relative;
    width: 100%;
    // height: 98px;
    background-color: #fff;
    padding-top: 20px;

    .header-input {
      width: 40%;
      height: 56px;
      position: absolute;
      top: 12px;
      left: 20px;
    }
  }
  .conentBox::-webkit-scrollbar {
    width: 0 !important;
  }
  .conentBox {
    width: 100%;
    display: flex;
		max-height: 90vh;
		overflow-y: scroll;
		position: relative;

    .tabsBox {
      width: 70%;
      max-height: 70%;
      min-height: 70%;
      position: sticky;
			left: 0;
      color: #333;

      .relevant {
        line-height: 56px;
        color: #666666;
        font-size: 18px;
      }
    }

    .absolute-right {
      color: #333;
      font-size: 16px;
      width: 20%;
      margin-left: 30px;
      margin-top: 130px;
      padding: 10px 20px;
      height: 530px;
      line-height: 40px;
      background-color: #fff;
			position: fixed;
			top:70px;
			right: 15%;

      .tabRight {
        div .right-color {
          width: 24px;
          height: 24px;
          display: inline-block;
          text-align: center;
          line-height: 24px;
          margin-right: 10px;
          color: #999999;
        }
        div:nth-child(1) .right-color {
          background-color: #ff5065;
          color: #fff;
          font-size: 14px;
        }
        div:nth-child(2) .right-color {
          background-color: #fd7150;
          color: #fff;
          font-size: 14px;
        }
        div:nth-child(3) .right-color {
          background-color: #ff9750;
          color: #fff;
          font-size: 14px;
        }
      }
    }
  }
}
</style>
<style lang="less">
.search-header {
  .el-input__inner {
    border: 1px solid #24a5e0;
    height: 46px;
    font-size: 18px;
  }

  .el-input-group__append {
    color: #fff;
    height: 46px;
    width: 100px;
    text-align: center;
    border: 1px solid #24a5e0;
    background-color: #24a5e0;
    cursor: pointer;
    font-size: 20px;
    transition-duration: 0.3s;
    transition-timing-function: ease;
  }
}

.tabsBox {
  .el-tabs__item {
    font-size: 20px;
    margin-top: 20px;
		color: #6666	;
  }

  .el-tabs__nav-wrap::after {
    height: 0;
  }

  .el-tabs__active-bar {
    height: 4px;
    line-height: 20px;
    border-radius: 10px;
    width: 40px !important;
  }
}

.absolute-right {
  .el-tabs__nav-wrap::after {
    height: 0;
  }
}
</style>
